<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <%@include file="/assets/publicjsp.jsp"%>
    <title>会议系统</title>

</head>
<body>
<%@include file="../assets/header.jsp"%>

<div class="d-flex align-items-stretch">
    <!-- Sidebar Navigation-->
    <%@include file="../assets/side.jsp"%>
    <!-- Sidebar Navigation end-->
    <div class="page-content">
        <div class="page-header">
            <div class="container-fluid">
                <h2 class="h5 no-margin-bottom">会议系统</h2>
            </div>
        </div>

        <section class="no-padding-bottom">

            <div class="list-group">
                <!--搜索文章的条件-->
                <div class="myTitle">
                    <form class="form-inline" action="${pageContext.request.contextPath}/meeting/findPage" method="get" id="searchForm">
                        <div class="form-group">
                            <label for="inlineFormInput" class="sr-only">Name</label>
                            <input id="inlineFormInput" name="title" value="${title}" type="text" placeholder="按标题名字查找" class="mr-sm-3 form-control">
                        </div>
                        
                        <!--选择状态-->
                        <div class="form-group" style="margin-right: 20px;">
                            <select name="status" class="form-control selectpicker" id="status">
                                <option value="">请选择状态</option>
                                <option value="0"  ${status==0?'selected':''}>未开始</option>
                                <option value="1"  ${status==1?'selected':''}>正在进行</option>
                                <option value="2"  ${status==2?'selected':''}>已结束</option>
                            </select>
                        </div>
						
						<div class="form-group">
						    <input type="submit" value="查询" class="btn btn-primary mr-sm-3 ">
						</div>
                    </form>

                    <input id = "addMeet" type="button" value="发布会议" class="btn btn-primary">


                </div>

                <ul class="myList">
                    <c:forEach items="${pageData.data}" var="meeting">
                        <li class="list-group-item">
                            <div style="float: right;">
                                <span><strong>状态：</strong>
                                    <c:if test="${meeting.status==0}">
                                        未开始
                                    </c:if>
                                    <c:if test="${meeting.status==1}">
                                        进行中
                                    </c:if>
                                    <c:if test="${meeting.status==2}">
                                        已结束
                                    </c:if>
                                </span>
                            </div>
                            <a href="${pageContext.request.contextPath}/meeting/meetingDetail?id=${meeting.id}">${meeting.title}</a>
                            <p class="h6"><strong>部门：</strong>${meeting.deptName}</p>
                            <p class="h6"><strong>开始时间：</strong>${meeting.startTime}</p>
                            <p style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis">${meeting.content}</p>
                        </li>
                    </c:forEach>
                </ul>
                <nav class="text-center" aria-label="Page navigation">
                    <ul class="pagination">
                        <li>
                            <a href="${pageContext.request.contextPath}/meeting/findPage?title=${title}&status=${status}&currPage=${pageData.currPage==1 ? pageData.currPage : pageData.currPage - 1}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <c:forEach begin="${pageData.begin}" end="${pageData.end}" step="1" var="p">
                            <c:choose>
                                <c:when test="${p == pageData.currPage}">
                                    <li><a class="nav-active" href="${pageContext.request.contextPath}/meeting/findPage?title=${title}&status=${status}&currPage=${p}">${p}</a></li>
                                </c:when>
                                <c:otherwise>
                                    <li><a href="${pageContext.request.contextPath}/meeting/findPage?title=${title}&status=${status}&currPage=${p}">${p}</a></li>
                                </c:otherwise>
                            </c:choose>
                        </c:forEach>
                        <li>
                            <a href="${pageContext.request.contextPath}/meeting/findPage?title=${title}&status=${status}&currPage=${pageData.currPage==pageData.totalPage ? pageData.currPage : pageData.currPage + 1}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </section>

        <%@include file="../assets/footer.jsp"%>
    </div>
</div>
</body>
</html>